package com.vdf.sisconsolid.rest.definition;

import java.util.Map;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import com.vdf.sisconsolid.controller.TracingController;
import com.vdf.sisconsolid.persistencemodule.dto.TracingDTO;

@Path("tracings")
public class RestTrancing {

	@GET
	@Path("{id}")
	@Produces("application/json")
	public Map<String, Object> getById(@PathParam("id") Long id) {
		return TracingController.processGetById(id);
	}
	
	@POST
	@Produces("application/json")
	public Map<String, Object> post(TracingDTO tracing) {
		return TracingController.processPostOrPut(tracing);
	}

	@PUT
	@Path("{id}")
	@Produces("application/json")
	public Map<String, Object> put(@PathParam("id") Long id, TracingDTO tracing) {
		return TracingController.processPostOrPut(tracing);
	}

	@DELETE
	@Path("{id}")
	@Produces("application/json")
	public Map<String, Object> delete(@PathParam("id") Long id) {
		return TracingController.processDelete(id);
	}
	
}
